<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>xpc.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">xpc.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    <span class='nodesc'>No description.</span>
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_net_xpc_xpc.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/net/xpc/xpc.js">Git</a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">/goog/net/xpc/xpc.js</div>
    </div>
  </div>
<hr/>


   
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>



<h2>Enumerations</h2>






<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.net.xpc.getRandomString"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.xpc.</span><span class="entryName">getRandomString<span class="args">(<span class="arg">length</span>,&nbsp;<span class="arg">opt_characters</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Returns a random string.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">length</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">How many characters the string shall contain.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_characters</span>
        : <span class="type">string=</span>
        <div class="entryOverview">The characters used.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            The random string.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line277">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>






  <h2>Global Variables</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.TransportNames.1"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">1</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line73">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.TransportNames.2"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">2</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line74">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.TransportNames.3"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">3</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line75">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.TransportNames.4"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">4</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line76">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.TransportNames.5"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">5</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line77">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.TransportNames.6"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">6</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line78">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.TransportNames.7"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">7</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line79">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.CfgFields.AUTH_TOKEN"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">AUTH_TOKEN</span>
        : 
     </div>


     <div class="entryOverview">
       Authorization token. If set, NIX will use this authorization token
to validate the setup.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line102">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.CfgFields.CHANNEL_NAME"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">CHANNEL_NAME</span>
        : 
     </div>


     <div class="entryOverview">
       Channel name identifier.
Both peers have to be initialized with
the same channel name.  If not present, a channel name is
generated (which then has to transferred to the peer somehow).

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line97">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.CfgFields.DIRECT_TRANSPORT_SYNC_MODE"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">DIRECT_TRANSPORT_SYNC_MODE</span>
        : 
     </div>


     <div class="entryOverview">
       Whether the direct transport runs in synchronous mode. The default is to
emulate the other transports and run asyncronously but there are some
circumstances where syncronous calls are required. If this property is
set to true, the transport will send the messages synchronously.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line198">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.CfgFields.IFRAME_ID"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">IFRAME_ID</span>
        : 
     </div>


     <div class="entryOverview">
       Ifame-ID identifier.
The id of the iframe element the peer-document lives in.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line116">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.CfgFields.LOCAL_POLL_URI"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">LOCAL_POLL_URI</span>
        : 
     </div>


     <div class="entryOverview">
       Local poll URI identifier (IframePollingTransport-specific).
The URI  (can't contain a fragment identifier)which is polled
to receive data from the peer.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line141">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.CfgFields.LOCAL_RELAY_URI"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">LOCAL_RELAY_URI</span>
        : 
     </div>


     <div class="entryOverview">
       Local relay URI identifier (IframeRelayTransport-specific).
The URI (can't contain a fragment identifier) used by the peer to
relay data through.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line129">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.CfgFields.NATIVE_TRANSPORT_PROTOCOL_VERSION"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">NATIVE_TRANSPORT_PROTOCOL_VERSION</span>
        : 
     </div>


     <div class="entryOverview">
       Which version of the native transport startup protocol should be used, the
default being '2'.  Version 1 had various timing vulnerabilities, which
had to be compensated for by introducing delays, and is deprecated.  V1
and V2 are broadly compatible, although the more robust timing and lack
of delays is not gained unless both sides are using V2.  The only
unsupported case of cross-protocol interoperation is where a connection
starts out with V2 at both ends, and one of the ends reconnects as a V1.
All other initial startup and reconnection scenarios are supported.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line191">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.CfgFields.ONE_SIDED_HANDSHAKE"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">ONE_SIDED_HANDSHAKE</span>
        : 
     </div>


     <div class="entryOverview">
       Usually both frames using a connection initially send a SETUP message to
each other, and each responds with a SETUP_ACK.  A frame marks itself
connected when it receives that SETUP_ACK.  If this parameter is true
however, the channel it is passed to will not send a SETUP, but rather will
wait for one from its peer and mark itself connected when that arrives.
Peer iframes created using such a channel will send SETUP however, and will
wait for SETUP_ACK before marking themselves connected.  The goal is to
cope with a situation where the availability of the URL for the peer frame
cannot be relied on, eg when the application is offline.  Without this
setting, the primary frame will attempt to send its SETUP message every
100ms, forever.  This floods the javascript console with uncatchable
security warnings, and fruitlessly burns CPU.  There is one scenario this
mode will not support, and that is reconnection by the outer frame, ie the
creation of a new channel object to connect to a peer iframe which was
already communicating with a previous channel object of the same name.  If
that behavior is needed, this mode should not be used.  Reconnection by
inner frames is supported in this mode however.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line173">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.CfgFields.PEER_HOSTNAME"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">PEER_HOSTNAME</span>
        : 
     </div>


     <div class="entryOverview">
       The hostname of the peer window, including protocol, domain, and port
(if specified). Used for security sensitive applications that make
use of NativeMessagingTransport (i.e. most applications).

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line153">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.CfgFields.PEER_POLL_URI"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">PEER_POLL_URI</span>
        : 
     </div>


     <div class="entryOverview">
       Local poll URI identifier (IframePollingTransport-specific).
The URI (can't contain a fragment identifier) used to send data
to the peer.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line147">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.CfgFields.PEER_RELAY_URI"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">PEER_RELAY_URI</span>
        : 
     </div>


     <div class="entryOverview">
       Peer relay URI identifier (IframeRelayTransport-specific).
The URI (can't contain a fragment identifier) used to relay data
to the peer.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line135">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.CfgFields.PEER_URI"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">PEER_URI</span>
        : 
     </div>


     <div class="entryOverview">
       The URI of the peer page.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line111">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.CfgFields.REMOTE_AUTH_TOKEN"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">REMOTE_AUTH_TOKEN</span>
        : 
     </div>


     <div class="entryOverview">
       Remote party's authorization token. If set, NIX will validate this
authorization token against that sent by the other party.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line107">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.CfgFields.ROLE"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">ROLE</span>
        : 
     </div>


     <div class="entryOverview">
       The frame role (inner or outer). Used to explicitly indicate the role for
each peer whenever the role cannot be reliably determined (e.g. the two
peer windows are not parent/child frames). If unspecified, the role will
be dynamically determined, assuming a parent/child frame setup.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line180">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.xpc.CfgFields.TRANSPORT"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">TRANSPORT</span>
        : 
     </div>


     <div class="entryOverview">
       Transport type identifier.
The transport type to use. Possible values are entries from
goog.net.xpc.TransportTypes. If not present, the transport is
determined automatically based on the useragent's capabilities.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_xpc_xpc.js.source.html#line123">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory xpc</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="" current="/goog/net/xpc/xpc.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
